import java.util.*;
class Student{
    private String id;//学号
    private String name;//姓名
    private char sex;//性别
    private int age;//表示年龄
    private double computer_score;//计算机课程的成绩
    private double english_score;//英语课的成绩
    private double maths_score;//数学课的成绩
    private double total_score;// 总成绩
    private double ave_score; //平均成绩
    public Student(String id, String name){
        this.id = id;
        this.name = name;
    }
    public Student(String id, String name, char sex, int age, double computer_score,double english_score,double maths_score){
        this(id, name);
        this.sex = sex;
        this.age = age;
        this.computer_score=computer_score;
        this.english_score=english_score;
        this.maths_score=maths_score;
    }
    public String getId(){
        return id;
    }//获得当前对象的学号，
    public double getComputer_score(){
        return computer_score;
    }//获得当前对象的计算机课程成绩,
    public double getMaths_score(){
        return maths_score;
    }//获得当前对象的数学课程成绩,
    public double getEnglish_score(){
        return english_score;
    }//获得当前对象的英语课程成绩,

    public void setId(String id){
        this.id=id;
    }// 设置当前对象的id值,
    public void setComputer_score(double computer_score){
        this.computer_score=computer_score;
    }//设置当前对象的Computer_score值,
    public void setEnglish_score(double english_score){
        this.english_score=english_score;
    }//设置当前对象的English_score值,
    public void setMaths_score(double maths_score){
        this.maths_score=maths_score;
    }//设置当前对象的Maths_score值,

    public double getTotalScore(){
        return computer_score+maths_score+english_score;
    }// 计算Computer_score, Maths_score 和English_score 三门课的总成绩。
    public double getAveScore(){
        return getTotalScore()/3;
    }// 计算Computer_score, Maths_score 和English_score 三门课的平均成绩。
    @Override
    public String toString(){
        total_score=getTotalScore();
        return "Student[姓名："+name+"，学号："+id+"，总成绩："+total_score+"]";
    }
}
class ComparatorByID implements Comparator<Student> {
    @Override
    public int compare(Student o1, Student o2)
    {
        return Integer.parseInt(o1.getId()) - Integer.parseInt(o2.getId());
    }
}
class ComparatorByMark implements Comparator<Student> {
    @Override
    public int compare(Student stu1, Student stu2){
        return (int)(stu1.getTotalScore()-stu2.getTotalScore());
    }
}